<?php
// +----------------------------------------------------------------------
// | ZanPianCMS
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.zanpiancms.com All rights reserved.
// +----------------------------------------------------------------------
// | BBS:  <http://www.zanpiancms.cc>
// +----------------------------------------------------------------------
namespace app\common\validate;
class User extends Base{
    protected $rule =   [
	    ['user_name', 'require|unique:user|alphaDash', '用户名必须填写|用户名已存在,请更换|用户名只能是汉字,字母,数字和下划线_及破折号-'],
		['user_email', 'unique:user|email', '邮箱已存在,请更换|邮箱格式不正确'],
		['qq_openid', 'unique', 'QQ已绑定'],
		['weibo_openid', 'unique', '微博已绑定'],
		['weiqrcode_openid', 'unique', '微信已绑定'],
		['user_mobile', 'unique:user|number|min:11|max:11', '手机号码已存在,请更换|手机必须为数字|手机位数错误|手机位数错误'],
		['user_password', 'require|length:6,15', '必须输入密码|密码最少6位最多15位'],
		['user_repassword', 'confirm:user_password', '确认密码和密码不同'],
    ];	
	protected $scene = array(
		'edit'     => 'user_name,user_email',
		'add'     =>  'user_name,user_email,user_mobile,user_password,user_repassword',
		'password' => 'user_password,user_repassword',
		'bind' => 'user_email,user_mobile'
	);

}